home *** CD-ROM | disk | FTP | other *** search
/ Palm Utilities / Palm_Utilities_CD-ROM_2001_2001.iso / files / utils misc / Bachmann Print Manager 2.01b / BachmannPrintManager.exe / SamplePrints / Incs / PageMgr.h next >
Encoding:
C/C++ Source or Header  |  1999-05-19  |  4.3 KB  |  143 lines

  1. /***********************************************************************
  2.  *
  3.  * Copyright ⌐ 1998, Bachmann Software and Services.
  4.  * All rights reserved.
  5.  *
  6.  * FileName:
  7.  *        PageMgr.h
  8.  *
  9.  * Description:
  10.  *        Page Manager library API definitions.  The Page Manager library
  11.  *        provides graphical printing for the Palm Computing Platform.
  12.  *
  13.  * History:
  14.  *       03/30/99    Greg Winton    Created file.
  15.  *
  16.  *    04/07/99    Greg Winton    Added functions:
  17.  *                               - PagPrintText
  18.  *                               - PagPrintLine
  19.  *                               - PagNewLine
  20.  *                               - PagNewPage
  21.  *                               - PagSetFont
  22.  *                               - PagWrite
  23.  *
  24.  *******************************************************************/
  25.  
  26. #ifndef __PAGE_MGR_H__
  27. #define __PAGE_MGR_H__
  28.  
  29. // If we're actually compiling the library code, then we need to
  30. // eliminate the trap glue that would otherwise be generated from
  31. // this header file in order to prevent compiler errors in CW Pro 2.
  32. #ifdef BUILDING_PAGE_MGR
  33.     #define PAGE_MGR_TRAP(trapNum)
  34. #else
  35.     #define PAGE_MGR_TRAP(trapNum) SYS_TRAP(trapNum)
  36. #endif
  37.  
  38.  
  39. // PalmPilot common definitions
  40. #include <Common.h>
  41. #include <SystemMgr.rh>
  42.  
  43. // PageMgr Definitions
  44. #include <PageMgrDefines.h>
  45. #include <SystemMgr.h>
  46.  
  47. //-----------------------------------------------------------------------------
  48. // Page Manager library function trap ID's. Each library call gets a trap number:
  49. //   pagTrapXXXX which serves as an index into the library's dispatch table.
  50. //   The constant sysLibTrapCustom is the first available trap number after
  51. //   the system predefined library traps Open,Close,Sleep & Wake.
  52. //
  53. // WARNING!!! The order of these traps MUST match the order of the dispatch
  54. //  table in SampleLibDispatch.c!!!
  55. //-----------------------------------------------------------------------------
  56.  
  57. typedef enum {
  58.    pagTrapGetLibAPIVersion = sysLibTrapCustom,
  59.    pagTrapSetOption,
  60.    pagTrapPrintText,
  61.    pagTrapPrintLine,
  62.    pagTrapNewLine,
  63.    pagTrapNewPage,
  64.    pagTrapSetFont,
  65.    pagTrapWrite,
  66.  
  67.     pagTrapLast
  68.     } PageMgrTrapNumberEnum;
  69.  
  70. /********************************************************************
  71.  * API Prototypes
  72.  ********************************************************************/
  73.  
  74. #ifdef __cplusplus
  75. extern "C" {
  76. #endif
  77.  
  78. //--------------------------------------------------
  79. // Standard library open, close, sleep and wake functions
  80. //--------------------------------------------------
  81.  
  82. extern Err PagOpen(UInt refNum, CharPtr printerName, CharPtr portName)
  83.                 PAGE_MGR_TRAP(sysLibTrapOpen);
  84.                 
  85. extern Err PagClose(UInt refNum)
  86.                 PAGE_MGR_TRAP(sysLibTrapClose);
  87.  
  88. extern Err PagSleep(UInt refNum)
  89.                 PAGE_MGR_TRAP(sysLibTrapSleep);
  90.  
  91. extern Err PagWake(UInt refNum)
  92.                 PAGE_MGR_TRAP(sysLibTrapWake);
  93.  
  94.  
  95. //--------------------------------------------------
  96. // Custom library API functions
  97. //--------------------------------------------------
  98.     
  99. // Get our library API version
  100. extern Err PagGetLibAPIVersion(UInt refNum, DWordPtr dwVerP)
  101.                 PAGE_MGR_TRAP(pagTrapGetLibAPIVersion);
  102.  
  103. // Set an option.
  104. extern Err PagSetOption(UInt refNum, PagOptionEnum option, DWord value)
  105.             PAGE_MGR_TRAP(pagTrapSetOption);
  106.  
  107. // Print text.
  108. extern Err PagPrintText(UInt refNum, CharPtr text)
  109.                 PAGE_MGR_TRAP(pagTrapPrintText);
  110.                 
  111. // Print a line of text.
  112. extern Err PagPrintLine(UInt refNum, CharPtr line)
  113.                 PAGE_MGR_TRAP(pagTrapPrintLine);
  114.                 
  115. // Go to next line.
  116. extern Err PagNewLine(UInt refNum)
  117.                 PAGE_MGR_TRAP(pagTrapNewLine);
  118.                 
  119. // Eject the current page.
  120. extern Err PagNewPage(UInt refNum)
  121.                 PAGE_MGR_TRAP(pagTrapNewPage);
  122.                 
  123. // Set the font.
  124. extern Err PagSetFont(UInt refNum, PagFontPtr fontP)
  125.                 PAGE_MGR_TRAP(pagTrapSetFont);
  126.                 
  127. // Write bytes to the printer.
  128. extern Err PagWrite(UInt refNum, BytePtr bytes, UInt len)
  129.                 PAGE_MGR_TRAP(pagTrapWrite);
  130.                 
  131. // For loading the library in PalmPilot Mac emulation mode
  132. extern Err PagInstall(UInt refNum, SysLibTblEntryPtr entryP);
  133.  
  134. #ifdef __cplusplus 
  135. }
  136. #endif
  137.  
  138. /********************************************************************
  139.  * Public Macros
  140.  ********************************************************************/
  141.  
  142. #endif    // __PAGE_MGR_H__
  143.